<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>物流费用配置</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
	#parse('/headFiles.html')
</head>
<body>
<div class="layui-fluid">
   	<div class="layui-form" id="LAY-form">
		<input name="id" type="hidden" value="$!{id}">
   		<div class="layui-form-item">
			<label class="layui-form-label">物流公司</label>
			<div class="layui-input-block">
				<select name="companyId" id="companyId" class="layui-hide" lay-ignore>
					<option value="$!{companyId}">$!{companyName}</option>
				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">区域范围</label>
			<div class="layui-input-block">
				<input type="radio" lay-filter="areaScope" name="areaScope" value="1" title="全国" $!{utils.eq($areaScope,1,'checked')}>
				<input type="radio" lay-filter="areaScope" name="areaScope" value="2" title="省" $!{utils.eq($areaScope,2,'checked')}>
			</div>
		</div>
		<div class="layui-form-item" id="areaPanel" style="display:$!{utils.eq($areaScope,2,'block','none')}">
			<label class="layui-form-label">区域</label>
			<div class="layui-input-block">
				<select name="province">
					#foreach($item in $provinceList)
					<option value="$!{item.name}" $!{utils.eq($item.name,$province,'selected')}>$!{item.name}</option>
					#end
				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">物流费用</label>
			<div class="layui-input-block">
				<input type="text" class="layui-input" name="moneyStr" lay-verify="required" placeholder="请输入物流费用，单位：元" autocomplete="off" value="$!{moneyStr}">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">免邮客单价</label>
			<div class="layui-input-block">
				<input type="text" class="layui-input" name="freeMinMoneyStr" lay-verify="required" placeholder="请输入最低免邮客单价，单位：元" autocomplete="off" value="$!{freeMinMoneyStr}">
			</div>
		</div>
	    <div class="layui-form-item layui-hide">
	    	<input type="button" lay-submit lay-filter="LAY-form-submit" id="LAY-form-submit" value="确认">
  		</div>
	</div>
</div>
#parse('/footFiles.html')
<script type="text/javascript">
layui.config({
  base: '$!{webRoot}/layuiadmin/'
}).extend({
  index: 'lib/index'
}).use(['index', 'form','selectN'],function (){
	var $ = layui.$, selectN = layui.selectN, form = layui.form;
	form.on('radio(areaScope)', function(data){
		if(data.value == 1){
			$('#areaPanel').hide();
		}else{
			$('#areaPanel').show();
		}
	});
	$('#companyId').select2({
		placeholder: "请选择物流公司",
		theme: 'bootstrap',
		ajax: {
			url: '$!{webRoot}/common/logistics_company/select.data',
			method: 'post',
			delay: 250,
			processResults: function (result) {
				if (result.code == 200) {
					return {
						pagination: {more: result.body.more},
						results: result.body.data || []
					};
				} else {
					return {results: []};
				}
			}
		}
	});
});
</script>
</body>
</html>